#include"comm.hpp"

int main()
{
    //向管道内写数据
    int fd = open(NAMED_PIPE, O_WRONLY);
    if(fd < 0)
    {
        perror("client open error");
        exit(1);
    }
    char buffer[1024];
    while(1) // 不断的通信
    {
        cout << "putin：";
        fgets(buffer, sizeof(buffer)-1, stdin);
        write(fd, buffer, strlen(buffer));
        sleep(1);
    }

    close(fd);
    
    return 0;
}